package com.hexb.smh.mapper;

import com.hexb.smh.entity.Config;
import com.hexb.smh.entity.EvaluateLevel;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author : hexb
 */
@Mapper
@Repository
public interface EvaluateLevelMapper {

    int save(EvaluateLevel evaluateLevel);

    List<EvaluateLevel> selectAll();

    List<EvaluateLevel> selectIncludes(@Param("valueFrom") BigDecimal valueFrom,
                                       @Param("valueTo") BigDecimal valueTo,
                                       @Param("id") Integer id);

    EvaluateLevel selectByValue(@Param("value") BigDecimal value);

    EvaluateLevel selectByValueCheck(@Param("valueFrom") BigDecimal valueFrom,
                                     @Param("valueTo") BigDecimal valueTo,
                                     @Param("id") Integer id);

    EvaluateLevel selectByName(@Param("levelName") String levelName,
                               @Param("id") Integer id);

    int update(EvaluateLevel evaluateLevel);

    @Delete("delete from evaluate_level where id=#{id}")
    int delete(Integer id);

    int deleteBatch(Integer[] ids);

}
